Method and apparatus for embedding digital-watermark using robustness parameter

ABSTRACT

An apparatus receives a document image and digital-watermark information and determines an embedding capacity based on a number of the letters in the document image. The apparatus determines whether or not the entire digital-watermark information is capable of being embedded in the document image based on the determined embedding capacity and embeds the digital-watermark information in the document image based on a result of the determination of whether or not the entire digital-watermark information is capable of being embedded in the document image.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.10/659,037, filed Sep. 9, 2003, and claims the benefit of JapaneseApplication No. 2002/264187 filed Sep. 10, 2002.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a technique for embeddingdigital-watermark information in an image.

2. Description of the Related Art

In recent years, digital data, such as text data, image data, and voicedata, has been widely used, and it has become necessary to preventunauthorized duplication of the data. Also, documents and images areoften used in a printed form, and thus unauthorized duplication of theprinted material must be prevented.

Digital-watermark embedding has been known as a technique for preventingunauthorized duplication. In this technique, original digital image datais modulated so that the data is imperceptible or difficult to perceive,and another piece of information is embedded in the data.

When digital-watermark information is embedded, it is very important todetermine whether or not necessary amount of information can be embeddedin original image data.

The following three elements are in tradeoff relationship: (1) qualityof image data in which digital-watermark information is embedded; (2)robustness to attack (image editing and so forth) on the image data; and(3) the amount of digital-watermark information to be embedded in theoriginal image data.

For example, if degradation of image quality caused by digital-watermarkembedding is suppressed, robustness to attack is reduced or the amountof information to be embedded is reduced. If the amount of informationto be embedded is increased, degradation of image quality caused bydigital-watermark embedding becomes significant or robustness to attackis reduced. If robustness to attack is increased, degradation of imagequality caused by digital-watermark embedding becomes significant or theamount of information to be embedded is reduced. The robustness toattack is referred to also as embedding strength.

As a technique for embedding digital-watermark information in amultivalued image, a method using redundancy of pixel density has beenknown. Also, as a technique for embedding digital-watermark informationin a binary document image, a digital-watermark embedding method usingthe characteristic of the document image has been known. For example,Japanese Patent Laid-Open No. 9-186603 (U.S. Pat. No. 5,861,619)discloses a method for embedding digital-watermark information bychanging the length of space between words. In such a method,digital-watermark information is represented by changing the length ofspace between words or letters, and 1-bit information (1 or 0) isallocated in accordance with the length of two spaces.

Also, “Digital Watermarking onto Japanese Documents by Seal Image”,written by Yasuhiro NAKAMURA and Kineo MATSUI (Information ProcessingSociety of Japan Journal Vol. 38, No. 11, November 1997), discloses atechnique of embedding digital-watermark information by rotating lettersso as to change the inclination angle of the letters.

FIG. 24 shows an example of the above-described known art. For example,when a letter is rotated clockwise, “1” is embedded therein as shown in(1) in FIG. 24. When a letter is rotated counterclockwise, “0” isembedded therein as shown in (2) in FIG. 24. Watermark may be embeddedin sequential letters, or every few letters, or in a letter at apredetermined position. In FIG. 24, the letter “C” is rotated clockwiseand the letter “E” is rotated counterclockwise. Accordingly, information“10” is embedded in this case.

Now, a method for embedding digital-watermark information in amultivalued image will be described. Hereinafter, image data representsa monochrome multivalued image for clarity.

A binary data sequence is regarded as additional information Inf. Theadditional information Inf is information including some bits, each bitrepresenting “0” or “1”. Then, digital-watermark information w isgenerated based on the additional information Inf. In the simplestmethod of generating the digital-watermark information w, an image isscanned by raster scanning and the additional information Inf isassociated with the position of image data I. When a bit represents “0”,−1 is allocated, and when a bit represents “1”, +1 is allocated.

Then, the image data I and the digital-watermark information w areinput, the digital-watermark information w is embedded in the image dataI, and then image data I′ in which the digital-watermark information wis embedded is output.

For example, digital-watermark information embedding is performed inaccordance with an equation: I′_(i,j)=I_(i,j)(1+aw_(i,j)). Herein,I′_(i,j) is image data in which digital-watermark information isembedded, I_(i,j) is image data before the digital-watermark informationis embedded therein, w_(i,j) is the digital-watermark information, i andj are parameters representing x and y coordinates of I and I′ and w,respectively, and a is a parameter specifying the embedding strength ofthe digital-watermark.

Now, the strength a will be described. For example, when the strength ais “0.01”, it means that about 1% of the element value of an originalimage is changed. By increasing the value of a, digital-watermarkinformation which is robust to attack can be embedded. In that case,however, quality of the image is significantly degraded. On the otherhand, by decreasing the value of a, the robustness to attack will bereduced. In that case, however, degradation of the image quality can besuppressed.

That is, by adequately setting the value of a, robustness to attack andthe quality of water-marked image can be kept in balance. Whendigital-watermark information is embedded in a multivalued image, theamount of information which can be embedded therein is effectivelyspecified based on the size of the original image.

On the other hand, when digital-watermark information is embedded in adocument image, the amount of information which can be embedded isgenerally proportional to the number of letters. The documents mayinclude newspapers, presentation material, and postcards, and the numberof letters included in these documents is different from each other.Therefore, when digital-watermark information is embedded in a documentimage, it is difficult and is not preferable to estimate the amount ofinformation which can be embedded therein in advance.

However, an efficient method of embedding digital-watermark informationin a document image considering the above-described three elements hasnot been known. Also, an efficient method of embedding digital-watermarkinformation in a multivalued image considering the above-described threeelements has not been established.

SUMMARY OF THE INVENTION

The present invention has been made in view of the above-describedproblems, and it is a major object of the present invention toefficiently embedding digital-watermark information in an image byconsidering the above-described three elements. In particular, it is anobject of the present invention to provide an effective technique ofembedding digital-watermark information in a document image.

In order to achieve the above-described objects, a digital-watermarkembedding method of the present invention comprises: a generating stepof generating digital-watermark information; an input step of inputtingan image; a setting step of setting a first parameter determiningrobustness to attack on the digital-watermark information embedded inthe image and a second parameter determining quality of the image inwhich the digital-watermark information is embedded; an embedding stepof embedding the digital-watermark information in the input image byusing the first and second parameters; a determination step ofdetermining whether or not the entire digital-watermark information canbe embedded in the image; an update step of updating one of theparameters so as to embed a larger amount of digital-watermarkinformation in the image when it is determined that the entiredigital-watermark information cannot be embedded in the determinationstep, the update step being performed as a first stage; and an embeddingstep of embedding the digital-watermark information in the input imageagain by using the updated parameter. The determination step isperformed for each of the embedding steps.

Further objects, features, and advantages of the present invention willbecome apparent from the following description of the preferredembodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a basic configuration of a digital-watermark embeddingdevice.

FIG. 2 shows the configuration of a digital-watermark embedding deviceof a first embodiment.

FIG. 3 is a flowchart of an operation of the digital-watermark embeddingdevice shown in FIG. 2.

FIG. 4 is a flowchart showing a method of embedding digital-watermark bychanging the inclination angle of a letter.

FIG. 5 is a flowchart showing a process in a robustness-priority forcedembedding mode.

FIG. 6 shows a state of change in f(n) and g(δθ).

FIG. 7 is a flowchart showing a process in an image-quality-priorityforced embedding mode.

FIG. 8 shows change in parameters in the image-quality-priority forcedembedding mode.

FIG. 9 is a flowchart showing a process in the robustness-priorityforced embedding mode.

FIG. 10 shows a state of change in f and g.

FIG. 11 is a flowchart showing a process in the image-quality-priorityforced embedding mode.

FIG. 12 is a flowchart showing an operation of a digital-watermarkembedding device having a function of changing pages of document imagein which digital-watermark information is to be embedded.

FIG. 13 is a flowchart showing an operation of the digital-watermarkembedding device having a function of changing pages of document imagein which digital-watermark information is embedded.

FIG. 14 shows part of document image before digital-watermarkinformation is embedded therein.

FIG. 15 shows part of document image after digital-watermark informationis embedded therein.

FIG. 16 shows the configuration of a digital-watermark embedding deviceaccording to a fifth embodiment.

FIG. 17 is a flowchart of an operation of the digital-watermarkembedding device shown in FIG. 16.

FIG. 18 is a flowchart showing a method of embedding digital-watermarkby changing the inclination angle of a letter.

FIG. 19 is a flowchart of an embedding process performed by using anembedding capacity checking unit and an image-quality/robustnessparameters control unit.

FIG. 20 shows combinations of values for obtaining each embeddingcapacity.

FIG. 21 shows combinations of values corresponding to each embeddingstrength.

FIG. 22 is a flowchart showing an operation of a digital-watermarkembedding device according to a sixth embodiment.

FIG. 23 shows the internal configuration of the digital-watermarkembedding device.

FIG. 24 shows an example of a known technique for embeddingdigital-watermark.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Hereinafter, preferred embodiments of the present invention will bedescribed in order.

First, a digital-watermark embedding device which can be applied to theembodiments of the present invention will be described with reference tothe drawings.

FIG. 1 shows a basic configuration of the digital-watermark embeddingdevice which can be applied to the embodiments of the present invention.

As shown in FIG. 1, the digital-watermark embedding device basicallyincludes an image input unit 101; a watermark information embedding unit102; an image-quality/robustness parameters control unit 106; and animage output unit 107.

As shown in FIG. 1, an image (original image 100) to whichdigital-watermark information 103 is to be embedded is input to theimage input unit 101 (for example, a scanner 1417 in FIG. 23, describedlater). Also, the digital-watermark information 103, embedding strength104, and an embedding mode 105 are input to the watermark informationembedding unit 102. Then, the watermark information embedding unit 102embeds the digital-watermark information in the original image 100 byusing the input digital-watermark information 103, the embeddingstrength 104, and the embedding mode 105. Accordingly, a water-markedimage 108 is generated. The water-marked image 108 is output from theimage output unit 107 (for example, a printer 1416 in FIG. 23, describedlater).

Herein, a normal mode and two types of forced embedding modes areprovided as the embedding mode 105. Also, an initial value of aparameter group for deciding robustness/image-quality degradation is setbased on specified embedding strength 104. Hereinafter, the outline ofeach mode will be described.

In the normal mode, digital-watermark information is embedded by usingthe set initial value. However, when the amount of information which canbe embedded is limited, the embedding is aborted.

On the other hand, in the forced embedding mode, a desired amount ofdigital-watermark information is forcedly embedded. The forced embeddingmode includes two types of modes: a robustness-priority forced embeddingmode and an image-quality-priority forced embedding mode.

The robustness-priority forced embedding mode is used for generating thewater-marked image 108 which is robust to future possible attacks, suchas image editing. Therefore, in this mode, the parameter group ischanged so that the robustness to attack can be maintained while theimage quality is degraded.

However, when the desired amount of digital-watermark information cannotbe embedded by changing the parameter group in the above-describedmanner, the parameter group is changed again so as to also reduce therobustness to attack. In order to perform the determination, a thresholdvalue for defining the tolerance of degradation of each of robustness toattack and image quality is set in advance.

If both of robustness to attack and image quality are out of thedegradation tolerance, it is determined that the tolerance is too smallto embed the desired amount of information.

However, in the forced embedding mode, the desired amount ofdigital-watermark information must be forcedly embedded. Therefore, whenboth of robustness to attack and image quality are out of the tolerance,the tolerance of image-quality degradation is increased and theparameter group is changed so as to further degrade the image quality.

Accordingly, a larger amount of digital-watermark information can beembedded, and thus the desired amount of digital-watermark informationmay be embedded. However, when the parameter group is changed so as todegrade the image quality, degradation of the image quality may reachits limit. For example, in digital-watermark embedding in which spacesbetween letters are adjusted, when letters contact each other,degradation of image quality reaches its limit. When the degradation ofimage quality reaches its limit, the parameter is changed so as toreduce the robustness to attack within the tolerance.

The threshold value may have a plurality of levels. In order to embed adesired amount of digital-watermark information, the image quality maybe degraded first, and then the parameter group may be changed in thefollowing order: degrade image quality, reduce robustness, degrade imagequality, reduce robustness, degrade image quality, . . . .

On the other hand, the image-quality-priority forced embedding mode isused for minimizing degradation of the quality of the water-marked image108. Therefore, when the desired amount of digital-watermark informationcannot be embedded, the parameter is first changed so as to reduce therobustness to attack, not to degrade the image quality.

However, when the desired amount of digital-watermark information cannotbe embedded by changing the parameter group in the above-describedmanner, the parameter group is changed again so as to also degrade theimage quality within the tolerance. In order to perform thedetermination, a threshold value for defining the tolerance ofdegradation of each of robustness to attack and image quality is set inadvance.

If both of robustness to attack and image quality are out of thedegradation tolerance, it is determined that the tolerance is too smallto embed the desired amount of information.

However, in the forced embedding mode, the desired amount ofdigital-watermark information must be forcedly embedded. Therefore, whenboth of robustness to attack and image quality are out of the tolerance,the tolerance of attack-robustness degradation is increased and theparameter group is changed so as to further reduce the robustness toattack.

Accordingly, a larger amount of digital-watermark information can beembedded, and thus the desired amount of digital-watermark informationmay be embedded. However, when the parameter group is changed so as toreduce the robustness to attack, degradation of the robustness may reachits limit. When the degradation of robustness to attack reaches itslimit, the parameter is changed so as to degrade the image qualitywithin the tolerance.

The threshold value may have a plurality of levels. In order to embed adesired amount of digital-watermark information, the robustness toattack may be reduced first, and then the parameter group may be changedin the following order: reduce robustness, degrade image quality, reducerobustness, degrade image quality, reduce robustness, . . . .

The above-described process in each mode is performed by theimage-quality/robustness parameters control unit 106.

By setting the threshold value and the embedding modes, a desired amountof digital-watermark information can be embedded within the degradationtolerances of robustness to attack and image quality, the tolerancesbeing defined by a user in advance.

Hereinafter, a specific method in each embodiment will be described.

First Embodiment

First, a digital-watermark embedding technique according to a firstembodiment of the present invention will be described.

FIG. 2 shows the configuration of a digital-watermark embedding deviceof the first embodiment. As in the above-described configuration shownin FIG. 1, the digital-watermark embedding device includes an imageinput unit 201; a watermark information embedding unit 207; animage-quality/robustness parameters control unit 208; and an imageoutput unit 209.

Further, in FIG. 2, a region-segmentation unit 202 for dividing a regionof an input original image 200 and a circumscribed rectangle extractingunit 203 for extracting a region of a letter are provided.Digital-watermark information 204, embedding strength 205, and anembedding mode 206 are the same as the above-described digital-watermarkinformation 103, the embedding strength 104, and the embedding mode 105,respectively.

FIG. 3 is a flowchart for explaining the operation of thedigital-watermark embedding device shown in FIG. 2. Hereinafter, theoperation of the digital-watermark embedding device shown in FIG. 2 willbe described with reference to the flowchart shown in FIG. 3.

First, a document image (original image 200) to which digital-watermarkinformation is to be embedded is read through the image input unit 201and is input to the region-segmentation unit 202 (step S301). Theregion-segmentation unit 202 segments the input document image into aplurality of attribute regions: a text region, a figure region, agraphic region, a table region, and so on (step S302).

Then, the circumscribed rectangle extracting unit 203 extractscircumscribed rectangles of letters included in the text region (stepS303). A circumscribed rectangle of a letter is a rectanglecircumscribing a letter, and is generally known as a region forrecognizing a letter. In this embodiment, however, the circumscribedrectangle is used as a minimum unit to be operated for embeddingdigital-watermark information.

In order to extract the circumscribed rectangle, the following methodmay be used. For example, each pixel value of the document image isprojected onto a vertical coordinate axis. Then, a blank part (partwithout a black letter) is searched for so as to determine lines, andthe document image is divided into lines. Then, the document image isprojected onto a horizontal coordinate axis in units of lines, blankpart is searched for, and each line is divided into a letter unit.Accordingly, each letter can be recognized in a circumscribed rectangle.

Then, the watermark information embedding unit 207 embeds thedigital-watermark information in the document image (step S304).Accordingly, a water-marked image 210 is generated (step S305).

Now, a process of embedding digital-watermark information by rotating aletter so as to change the inclination angle of the letter, the processbeing performed by the watermark information embedding unit 207, will bedescribed.

FIG. 4 is a flowchart for explaining the process. First, thedigital-watermark information 204 to be embedded in the document imageis input (step S401).

Then, a first letter to which the digital-watermark information 204 isto be embedded is selected in the document image (step S402).

Then, it is determined whether or not the bit of the digital-watermarkinformation to be embedded is 1 (step S403). If the bit is 1 (YES in theflowchart), the letter is inclined in a clockwise direction (step S404).On the other hand, if the bit is 0 (NO in the flowchart), the letter isinclined in a counterclockwise direction (step S405).

In this embodiment, 1-bit information is embedded in a letter bydetermining a clockwise turn or a counterclockwise turn. However, thepresent invention is not limited to this method. In a modification, anabsolute value of the inclination angle may be divided into a pluralityof levels and different pieces of embedding information may be allocatedto these levels. Specifically, it is regarded that 0 (counterclockwise)or 1 (clockwise) is embedded. Further, a threshold value is set inincrements of 2 degrees from 2 to 20 degrees of the inclination angle,and it is regarded that the bit of embedded watermark information isincreased by 1 bit as the inclination angle increases by 2 degrees. Inthis case, 1 to 10 bits may be embedded in a letter.

Then, it is determined whether or not the letter which is beingprocessed is the last letter of the document (step S406). If the letteris the last letter (YES in the flowchart), the process of embeddingdigital-watermark information is completed. On the other hand, if theletter is not the last letter (NO in the flowchart), the process returnsto step S402 so as to select a next letter.

The water-marked image 210 is output from the image output unit 209(step S306). In this embodiment, output means printing of the image orstoring the image data in a storage device or the like. Alternatively,the image data may be transmitted to another terminal through a networkor the like.

By repeatedly embedding digital-watermark information in the documentimage, correct information can be extracted even when part of thedigital-watermark information lacks or when error is caused. That is,robustness of the digital-watermark information can be increased.

As in the first embodiment, when digital-watermark information isembedded by inclining a letter, robustness to duplication of awater-marked image can be effectively increased by increasing rotationrange δθ of a letter. However, the inclination angle of a letter becomeslarger as the robustness is increased, and thus the appearance of theletter in the document image becomes unnatural. In the above-describedalgorithm of embedding digital-watermark information, a parameterdetermining the quality of image is the rotation range (inclination) ofa letter. As the rotation range increases, robustness to duplication ofa printed water-marked image increases, and/or the amount of informationwhich can be embedded in the image advantageously increases. In thatcase, however, the document image looks unnatural, which isdisadvantageous.

On the other hand, as the number of times a piece of digital-watermarkinformation is embedded (repetition number) increases, reliability ofextracting correct digital-watermark information increases. In thatcase, however, the amount of information which can be embedded in animage decreases disadvantageously. Herein, a parameter determining therobustness is indicated by the repetition number for clarity.

As described above, robustness to attack (embedding strength), imagequality, and the amount of information are in tradeoff relationship.

In this embodiment, two other parameters which determine robustness toattack correspond to the rotation range of a letter and the repetitionnumber of embedding desired digital-watermark information in a documentimage. The repetition number is the number of times a piece ofdigital-watermark information is embedded in a document image.

Herein, embedding strength is defined to be proportional to f(n), whichis obtained by normalizing the repetition number n of embedding. On theother hand, image quality is defined to be inversely proportional tog(δθ), which is obtained by normalizing the rotation range δθ of aletter.

In this embodiment, the repetition number n is at least 3. That is, whena piece of digital-watermark information is embedded in a document imageless than three times, it is determined that the entiredigital-watermark information has not been embedded. This is the minimumnumber for reliably extracting digital-watermark information.

Also, a maximum value of the rotation range of a letter is set so as toprevent unnatural appearance thereof, for example, is set to 20 degrees.Actually, a physical minimum value of the repetition number is 1, and aphysical maximum value of the rotation range of a letter is 180 degrees.These values may be naturally applied.

Next, the processes of the two types of forced embedding modes of thepresent invention: robustness-priority forced embedding mode andimage-quality-priority forced embedding mode, will be described.

(i) Robustness-priority Forced Embedding Mode

FIG. 5 is a flowchart showing a process performed when therobustness-priority forced embedding mode is selected. The process shownin FIG. 5 corresponds to a step of embedding digital-watermarkinformation, that is, S304 in FIG. 3.

First, in step S304-1 a, desired embedding strength is specified and isinput to the device. Then, in step S304-1 b, the repetition number andthe rotation range are set to the initial values based on the embeddingstrength. Then, in step S304-1 c, all letters to be processed in thedocument image 200 are rotated in order so as to embed thedigital-watermark information therein. After the digital-watermarkinformation has been embedded in all the letters, the process proceedsto step S304-1 d.

In step S304-1 d, it is checked whether or not the entire desireddigital-watermark information 204 has been embedded in the documentimage 200. If the entire information has not been embedded (NO in theflowchart), the process proceeds to step S304-1 e in order to embed theentire information in the document image.

Repetition of embedding, which will be described later, is restarted ina state that the previous embedding is regarded not to have beenperformed. That is, actually, digital-watermark information is embeddedin the original document image based on a new parameter. Therefore, theprevious digital-watermark information is not overwritten with newdigital-watermark information.

In step S304-1 e, it is determined whether or not the rotation range ofa letter has reached a threshold value. If the rotation range has notreached the threshold value (NO in the flowchart), the process proceedsto step S304-1 f.

In step S304-1 f, since a high priority is given to robustness to attackin this mode, the rotation range of a letter is increased so as todegrade the image quality. Then, digital-watermark information isembedded again based on the newly set parameters (repetition number androtation range). The above-described steps are repeatedly performed soas to embed the entire desired digital-watermark information.

FIG. 6 shows the change in f(n) and g(δθ). Arrows in the figure indicatea state where the parameters of the repetition number (f) and therotation range (g) change to an unfavorable state. That is, in FIG. 6,the arrow of the repetition number (f) indicates decrease, and therobustness to attack reduces in accordance with the decrease. On theother hand, the arrow of the rotation range (g) indicates increase, andthe quality of the water-marked image is degraded in accordance with theincrease.

Steps S304-1 e and S304-1 f correspond to stage (1) in FIG. 6. In stage(1), further degradation of the image quality (increase in rotationrange) is allowed.

In step S304-1 e, if the rotation range has reached Threshold 1 orThreshold 2 (YES in step S304-1 e), a step of increasing the rotationrange is stopped so as to try to decrease the repetition number.

At this time, in step S304-1 g, it is determined whether or not therepetition number has reached the threshold value. If the repetitionnumber has not reached the threshold value (NO in the flowchart), theprocess proceeds to step S304-1 h, where the repetition number isdecreased so as to increase the amount of information which can beembedded. The change in the parameter (repetition number) at this timecorresponds to stage (2) in FIG. 6.

On the other hand, in step S304-1 g, if the repetition number hasreached the threshold value (YES in the flowchart), the process proceedsto step S304-1 i, where it is determined whether or not the rotationrange has reached the maximum. If the rotation range has not reached themaximum (NO in the flowchart), the process proceeds to step S304-1 j,where the rotation range is increased again. The change in the parameter(rotation range) at this time corresponds to stage (3) in FIG. 6. Instage (3), the level of degradation of image quality is over Threshold1, and thus the threshold value is changed so as to embed the entiredigital-watermark information correctly.

On the other hand, in step S304-1 i, if the rotation range has reachedthe maximum of 180 degrees (YES in the flowchart), the process proceedsto step S304-1 k, where it is determined whether or not the repetitionnumber has reached the minimum of 1. If the repetition number has notreached the minimum (NO in the flowchart), the process proceeds to stepS304-1 l, where the repetition number is reduced again. The change inthe parameter (repetition number) at this time corresponds to stage (4)in FIG. 6. On the other hand, if the repetition number has reached theminimum (YES in the flowchart), the process of embedding thedigital-watermark information cannot be continued any more (correctinformation cannot be embedded). Thus, the process proceeds to stepS304-1 m, where it is determined that embedding ended in failure, so asto stop the embedding process.

(ii) Image-quality-priority Forced Embedding Mode

Next, an embedding process performed when the image-quality-priorityforced embedding mode is selected will be described.

FIG. 7 is a flowchart showing a process performed when theimage-quality-priority forced embedding mode is selected.

First, in step S304-2 a, desired embedding strength is specified and isinput to the device. Then, in step S304-2 b, the repetition number andthe rotation range are set to the initial values based on the embeddingstrength. Then, in step S304-2 c, all letters to be processed in thedocument image 200 are rotated in order so as to embed thedigital-watermark information therein. After digital-watermarkinformation has been embedded in all the letters, the process proceedsto step S304-2 d.

In step S304-2 d, it is checked whether or not the entire desireddigital-watermark information 204 has been embedded in the documentimage 200. If the entire information has not been embedded (NO in theflowchart), the process proceeds to step S304-2 e in order to embed theentire information in the document image. Then, a process of correctlyembedding the digital-watermark information is performed in accordancewith the following steps.

FIG. 8 shows the change in f(n) and g(δθ) in the image-quality-priorityforced embedding mode. Arrows in the figure indicate a state where theparameters of the repetition number (f) and the rotation range (g)changes to an unfavorable state. The system of FIG. 8 is the same asthat of FIG. 6, and thus a detailed description is omitted.

In step S304-2 e, it is determined whether or not the repetition numberhas reached the threshold value. If the repetition number has notreached the threshold value (NO in the flowchart), the process proceedsto step S304-2 f, where the repetition number is reduced. The change inthe parameter (repetition number) at this time corresponds to stage (1)in FIG. 8. Herein, since the image-quality-priority mode is selected,reduction of robustness to attack is allowed to some extent, andincrease in the rotation range is suppressed. On the other hand, in stepS304-2 e, if the repetition number has reached the threshold value (YESin the flowchart), a step of decreasing the repetition number issuspended.

Then, in step S304-2 g, it is determined whether or not the rotationrange has reached the threshold value. If the rotation range has notreached the threshold value (NO in the flowchart), the process proceedsto step S304-2 h, where the rotation range is increased so as toincrease the amount of digital-watermark information which can beembedded. The change in the parameter (rotation range) at this timecorresponds to stage (2) in FIG. 8.

On the other hand, if the rotation range has reached Threshold 1 (YES inthe flowchart), degradation of the image quality has reached afirst-stage limit, and thus the process proceeds to step S304-2 i, whereit is determined whether or not the repetition number has reached theminimum. If the repetition number has not reached the minimum (NO in theflowchart), the process proceeds to step S304-2 j, where the repetitionnumber is decreased again so as to try to increase the amount ofdigital-watermark information which can be embedded. The change in theparameter (repetition number) at this time corresponds to stage (3) inFIG. 8.

On the other hand, in step S304-2 i, if the repetition number hasreached the minimum (YES in the flowchart), the process proceeds to stepS304-2 k, where it is determined whether or not the rotation range hasreached the maximum. If the rotation range has not reached the maximum(NO in the flowchart), the process proceeds to step S304-2 l, where therotation range is increased so as to try to increase the amount ofdigital-watermark information which can be embedded. The change in theparameter at this time corresponds to stage (4) in FIG. 8.

On the other hand, in step S304-2 k, if the rotation range has reachedthe maximum (YES in the flowchart), the process of embedding thedigital-watermark information cannot be continued any more (correctinformation cannot be embedded). Thus, the process proceeds to stepS304-2 m, where it is determined that embedding ended in failure, so asto stop the embedding process.

As described above, in the robustness-priority embedding mode,degradation of image quality is controlled first in order to embed adesired amount of digital-watermark information. When stepwisedegradation is required, the parameter group is changed in the followingorder: degrade image quality to a first threshold (1), reduce robustnessto a first threshold (2), degrade image quality to a second threshold(3), reduce robustness to a second threshold (4), degrade image qualityto a third threshold (5), reduce robustness to a third threshold (6), .. . .

On the other hand, in the image-quality-priority embedding mode,degradation of robustness to attack is controlled first in order toembed a desired amount of digital-watermark information. When stepwisedegradation is required, the parameter group is changed in the followingorder: reduce robustness to a first threshold (1), degrade image qualityto a first threshold (2), reduce robustness to a second threshold (3),degrade image quality to a second threshold (4), reduce robustness to athird threshold (5), degrade image quality to a third threshold (6) . .. .

Second Embodiment

In the first embodiment, the repetition number is regarded as a firstparameter determining robustness to attack. However, another value maybe regarded as the first parameter determining robustness to attack. Inthe second embodiment, information to be embedded is encoded with anerror-correction code in a process of embedding digital-watermarkinformation by changing the inclination angle of a letter.

When digital-watermark information is embedded in a document image,encoding with an error-correction code can be adopted in order tostrengthen the robustness to attack on the digital-watermarkinformation. In the second embodiment, error-correction ability in theerror-correction encoding is regarded as the first parameter determiningthe robustness to attack. The second parameter determining image qualityis the rotation range, as in the first embodiment.

The possibility of correctly extracting and recognizingdigital-watermark information increases and robustness to attack isimproved as the error-correction ability of the error-correction codebecomes higher. On the other hand, when digital-watermark information isencoded into a code having high error-correction ability, the codelength increases, and thus the amount of digital-watermark informationwhich can be embedded substantially decreases. This principle is thesame as in the repetition number in the first embodiment.

In the first embodiment, only the repetition number is regarded as thefirst parameter for clarity. However, as described in the firstembodiment, robustness to attack does not always depend only on a singleparameter. For example, robustness to attack may also depend onerror-correction ability and rotation range of a letter. Therefore,various factors may be regarded as a parameter which determinesdegradation of each of robustness to attack and image quality.

In this embodiment, embedding strength (robustness to attack) isrepresented by multiplying f(t) obtained by normalizing error-correctionability t by g(δθ) obtained by normalizing the rotation range δθ. Thatis, the following equation is obtained:Strength=f(t)×g(δθ)  equation (1).In this embodiment, in order to embed digital-watermark informationhaving some robustness to attack, t and δθ are set to values so that theStrength can be obtained. Herein, a threshold value defining thetolerance of error-correction ability is set to 1, and a physical limitis set to 0. The rotation range of a letter is the same as in the firstembodiment.(iii) Robustness-priority Forced Embedding Mode

First, the robustness-priority forced embedding mode will be described.FIG. 9 is a flowchart for explaining an embedding process performed whenthe robustness-priority forced embedding mode is selected. In the secondembodiment, the step of changing the repetition number in FIG. 5 isreplaced by a step of changing the error-correction ability of anerror-correction code, and the above-described embedding strength isapplied. Hereinafter, part different from the first embodiment is mainlyexplained. Steps S304-3 a to S304-3 d are the same as in FIGS. 5 and 7.

In step S304-3 e, it is determined whether or not the error-correctionability t is more than 0. If the error-correction ability t is more than0 (YES in the flowchart), the process proceeds to step S304-3 f, wherethe error-correction ability is reduced and the code length obtainedafter error-correction encoding is reduced, so as to increase the amountof digital-watermark information which can be embedded.

Since a priority is given to robustness, δθ is obtained based on thefollowing equation:δθ=g ⁻¹(Strength/f(t))  equation (2)so that the substantial robustness becomes equal to specified strength.In this way, the tolerance of rotation range of a letter is set large(steps S304-3 g and S304-3 h).

Then, in step S304-3 i, it is determined whether or not the rotationrange has reached the threshold value. If the rotation range has notreached the threshold value (NO in the flowchart), the process returnsto step S304-3 c, where digital-watermark information is embedded againbased on a newly set parameter. Then, the above-described steps arerepeatedly performed so as to correctly embed the entiredigital-watermark information. If the rotation range has reached thethreshold value (YES in the flowchart), the process proceeds to stepS304-3 l.

FIG. 10 shows the change in the error-correction ability (f) and therotation range (g). Arrows in the figure indicate a state where theparameters of the error-correction ability (f) and the rotation range(g) change to an unfavorable state. The system of FIG. 10 is the same asthat of FIG. 6. A feature in FIG. 10 is that, in a first stage (1) ofadjusting the parameters, the parameters (f and g) are changed so thatthe robustness (strength) to attack is kept constant. Another feature isthat the parameter g is continuously increased in the transition fromstage (2) to stage (3).

In step S304-3 d, it is checked whether or not the entire desireddigital-watermark information 204 has been embedded in the documentimage 200. If the entire information has not been embedded (NO in theflowchart), the process proceeds to step S304-3 e so as to embed theentire digital-watermark information in the document image in accordancewith the following steps.

In step S304-3 e, if the error-correction ability has reached thethreshold value (NO in the flowchart), the process of reducing theerror-correction ability of the error-correction code is stopped and theprocess proceeds to step S304-3 j. In step S304-3 j, it is determinedwhether or not the rotation range has reached the threshold value.

In step S304-3 j, if the rotation range has not reached the thresholdvalue (NO in the flowchart), the process proceeds to step S304-3 k,where the tolerance of rotation range is increased so as to increase theamount of digital-watermark information which can be embedded. Thechange in the parameter (rotation range) at this time corresponds tostage (2) in FIG. 10.

In step S304-3 j, if the tolerance of rotation range has reached thethreshold value, the process proceeds to step S304-3 l. In step S304-3l, it is determined whether or not the rotation range has reached themaximum. If the rotation range has reached the maximum, the processproceeds to step S304-3 m, where the tolerance of rotation range isincreased so as to increase the amount of digital-watermark informationwhich can be embedded. The change in the parameter (rotation range) athis time corresponds to stage (3) in FIG. 10.

The error-correction ability is reduced in stage (4), the rotation rangeis increased in stage (5), and the error-correction ability is reducedagain in stage (6). Such a switching operation is the same as in thefirst embodiment.

(iv) Image-quality-priority Forced Embedding Mode

The process in the image-quality-priority forced embedding mode is shownin FIG. 11. In this process, error-correction ability is regarded as thefirst parameter, which corresponds to the repetition number in FIG. 7.Therefore, the corresponding description will be omitted.

Third Embodiment

In the above-described embodiments, it is provided that the lettersincluded in the document image to which digital-watermark information isembedded is included in a page. However, the document image oftenincludes a plurality of pages. In the third embodiment,digital-watermark information is embedded in a plurality of pages, inaddition to the processes of reducing the repetition number and theerror-correction ability.

FIGS. 12 and 13 show the operations of the third embodiment. In theprocesses shown in these figures, a step of setting a page to whichdigital-watermark information is embedded to a next page is performedwhen it is determined that the repetition number has reached the minimum(step S304-1 k in FIG. 5) in the embedding process of the firstembodiment. FIG. 12 shows a process of the robustness-priority forcedembedding mode as in FIG. 5, and the process shown in FIG. 12 is thesame as that in FIG. 5, except that a next page may exist in FIG. 12.FIG. 13 shows a process of the image-quality-priority forced embeddingmode as in FIG. 7, and the process shown in FIG. 13 is the same as thatin FIG. 7, except that a next page may exist in FIG. 13. Hereinafter,both processes are described briefly.

In step S304-5 k in FIG. 12, it is determined whether or not therepetition number has reached the minimum. If the repetition number hasreached the minimum (YES in the flowchart), the process proceeds to stepS304-5 m, where it is determined whether or not the page which is beingprocessed is the last page. If a next page exist (NO in the flowchart),the process proceeds to step S304-5 o, where the page to whichdigital-watermark information is to be embedded is changed to the nextpage. Then, the step of embedding digital-watermark information isperformed again. If a next page does not exist (YES in the flowchart),the process of embedding digital-watermark information is ended infailure (step S304-5 n).

In step S304-6 k in FIG. 13, it is determined whether or not therotation range has reached the maximum. If the rotation range hasreached the maximum (YES in the flowchart), the process proceeds to stepS304-6 m, where it is determined whether or not the page which is beingprocessed is the last page. If a next page exist (NO in the flowchart),the process proceeds to step S304-6 o, where the page to whichdigital-watermark information is to be embedded is changed to the nextpage. Then, the step of embedding digital-watermark information isperformed again. If a next page does not exist (YES in the flowchart) instep S304-6 m, the process of embedding digital-watermark information isended in failure (step S304-6 n).

In this embodiment, a problem of a document image, that is, the numberof letters in which digital-watermark information is to be embedded islimited, can be solved by forming the document image with a plurality ofpages.

Fourth Embodiment

The embedding strength (robustness to attack) in the first embodimentcan be associated with each parameter, as in the second embodiment. Atthis time, the error-correction ability t in the equations (1) and (2)in the second embodiment is replaced by the repetition number n.

It is also possible to define that the embedding strength in the secondembodiment depends only on f, which is obtained by normalizing therepetition number n, as in the first embodiment.

In the above-described embodiments, digital-watermark information isembedded by rotating a letter, but another method may be used. Forexample, digital-watermark information may be embedded by changing aspace between letters. Hereinafter, this embedding method will bedescribed.

FIG. 14 shows part of a document image which has not been water-marked.FIG. 15 shows part of a document image obtained by water-marking thedocument image shown in FIG. 14. In FIG. 14, P₀, S₀, P₁, and S₁ arevalues indicating the lengths of spaces between the letters. P₀, S₀, P₁,and S₁ in FIG. 14 are adjusted based on a predetermined rule in order toembed digital-watermark information, so as to be P₀′, S₀′, P₁′, and S₁′in FIG. 15.

In FIGS. 14 and 15, five letters and four spaces are provided. In thisembodiment, two space-lengths P_(n) and S_(n) are used for embedding1-bit digital-watermark information. Thus, 2-bit digital-watermarkinformation can be embedded by using four spaces P₀, S₀, P₁, and S₁. Inthis embodiment, P_(n)>S_(n) indicates 1 and P_(n)<S_(n) indicates 0.

In FIG. 14, when the letter between P₀ and S₀ is shifted to the left andwhen the letter between P₁ and S₁ is shifted to the left, P₀′<S₀′ andP₁′<S₁′, as shown in FIG. 15. In this case, 2-bit digital-watermarkinformation “0,0” has been embedded.

On the other hand, when the letter between P₀ and S₀ is shifted to theleft and when the letter between P₁ and S₁ is shifted to the right,P₀′<S₀′ and P₁′>S₁′ in FIG. 15. In this case, 2-bit digital-watermarkinformation “0,1” has been embedded.

In this embodiment, movement amount x of a letter is used instead of therotation amount θ of a letter in the first to third embodiments.Accordingly, the first parameter corresponds to the repetition number orthe error-correction ability as in the first to third embodiments, andthe second parameter corresponds to the movement range of each letter.

Fifth Embodiment

FIG. 16 shows the configuration of a digital-watermark embedding deviceaccording to a fifth embodiment, and FIG. 17 shows the operation of thedevice shown in FIG. 16. Hereinafter, the function and operation of eachunit of this embodiment will be described with reference to FIGS. 16 and17.

First, a document image (original image 1100) in which digital-watermarkinformation is to be embedded is read through an image input unit 1101and is input to a region-segmentation unit 1102 (step S1301). Theregion-segmentation unit 1102 segments the input document image into aplurality of attribute regions: a text region, a figure region, agraphic region, a table region, and so on (step S1302).

A circumscribed rectangle extracting unit 1103 extracts circumscribedrectangles of the letters included in the text region (step S1303). Acircumscribed rectangle of a letter is a rectangle circumscribing aletter, and is generally known as a region for recognizing a letter. Inthis embodiment, however, the circumscribed rectangle is used as aminimum unit to be operated for embedding digital-watermark information.A method of extracting the circumscribed rectangle has been describedabove.

Now, a digital-watermark information embedding method performed by awatermark information embedding unit 1108 is described. FIG. 18 shows aprocess of embedding digital-watermark information by changing theinclination angle of a letter. First, digital-watermark information tobe embedded is input (step S1401). Then, the first letter in whichdigital-watermark information is embedded is selected (step S1402).Then, it is determined whether or not the bit of the digital-watermarkinformation to be embedded is 1 (step S1403). If the bit is 1 (YES inthe flowchart), the letter is inclined in a clockwise direction (stepS1404). On the other hand, if the bit is 0 (NO in the flowchart), theletter is inclined in a counterclockwise direction (step S1405). Theembedding information can be increased in accordance with the absolutevalue of the inclination angle. For example, 0 or 1 is determinedaccording to counterclockwise or clockwise. In this case, a thresholdvalue is set in increments of 2 degrees from 2 to 20 degrees of theinclination angle, and 10 bits may be embedded in a letter. The abovedescription is basically the same as in the first embodiment.

Then, it is determined whether or not the letter is the last letter ofthe document (step S1406). If the letter is the last letter (YES in theflowchart), the process of embedding digital-watermark information iscompleted. On the other hand, if the letter is not the last letter (NOin the flowchart), the process returns to step S1402 so as to select anext letter. The water-marked image is output from the image output unit1110 (step S1306). The output image may be printed out or may be storedin a storage device or the like in the form of image data.Alternatively, the image data may be transmitted to another terminalthrough a network or the like.

By repeatedly embedding digital-watermark information in the documentimage, correct information can be extracted even when part of thedigital-watermark information lacks or when error is caused. That is,robustness can be increased.

As in this embodiment, when digital-watermark information is embedded byinclining a letter, robustness to duplication of a water-marked imagecan be effectively increased by increasing a letter rotation range δθ.However, the inclination angle of a letter becomes larger as therobustness is increased, and thus the appearance of the letter in thedocument image becomes unnatural. In the above-described algorithm ofembedding digital-watermark information, a parameter determining thequality of image is the rotation range (inclination) of a letter. As therotation range increases, robustness to duplication of a printedwater-marked image increases, and/or the amount of information which canbe embedded in the image advantageously increases. In that case,however, the document image looks unnatural, which is disadvantageous.

On the other hand, as the number of times a piece of digital-watermarkinformation is embedded (repetition number) increases, reliability ofextracting correct digital-watermark information increases. In thatcase, however, the amount of information which can be embedded in animage decreases disadvantageously. Herein, a parameter determining therobustness corresponds only to the repetition number for clarity.

Herein, embedding strength is indicated by an integer from 1 to 10 foruser's intuitive understanding. This range may be changed, andcontinuous values may be used instead of discrete values.

FIG. 19 is a flowchart for explaining an embedding process performed byusing the embedding capacity checking unit 1104 and theimage-quality/robustness parameters control unit 1109. First, embeddingstrength 1106, an embedding mode 1107, and digital-watermark information1105 are input (step S304-1 a).

Then, the number of letters in the image 1100, in which thedigital-watermark information is to be embedded, is counted, so as toobtain basic data for calculating the capacity for embedding(step S304-1b). The minimum of the repetition number is set to 3, for example. Thisis the minimum number for absorbing instability at extraction ofwatermark information. The maximum of repetition number is set so thatthe amount of information which can be embedded does not become 0.

Then, the repetition number, which is an embedding parameter, is changedfrom the minimum to the maximum, so as to calculate the embeddingcapacity (step S304-1 c). Herein, the image-quality parameter is fixed.In an algorithm for the calculation, embedding capacity can be obtainedby dividing the number of letters by the repetition number. Of course,the embedding capacity is further reduced when header information isstored. In accordance with the algorithm, the repetition number issequentially increased so as to calculate corresponding embeddingcapacity. FIG. 20 shows the combinations of values for obtaining eachembedding capacity. In FIG. 20, when the repetition number is 3, theembedding capacity is 200.

Then, the calculated values are associated with embedding strength (stepS304-1 d). As shown in FIG. 20, 19 types of embedding capacitance arepossible. On the other hand, the embedding strength is fixed to 10levels, and thus the parameters and the embedding capacity must bethinned out. In this example, the embedding capacity when the repetitionnumber is an even number is associated with each strength.

FIG. 20 shows embedding capacity labeled with l₁ to 1 ₁₀, which isassociated with embedding strength so as to present to the user. Thecorresponding image-quality parameters are constant, but they arelabeled with q₁ to q₁₀ for generality. The corresponding repetitionnumbers are also labeled with n₁ to n₁₀. FIG. 21 shows groups of valueswhich are associated with embedding strength.

Then, by using the result of step S304-1 d, it is determined whether ornot the embedding capacity obtained based on the embedding strengthinput by the user is larger than the digital-watermark information to beembedded (step S304-1 e). If the embedding capacity is larger than thedigital-watermark information (YES in the flowchart), the embeddingprocess is continued (step S304-1 k). At this time, the repetitionnumber of embedding is maximized within the range of capacity forstoring the digital-watermark information to be embedded.

For example, the user inputs digital-watermark information havingembedding strength of 6 and length of 12. As can be understood fromFIGS. 20 and 21, embedding capacity corresponding to embedding strength6 is 18. However, since the size of the digital-watermark information is12, the repetition number can be increased to 15, which corresponds toembedding capacity of 13. That is, robustness can be increased toembedding strength of 7.

On the other hand, when the result of step S304-1 e is NO, it isdetermined whether or not the input embedding mode is therobustness-priority forced embedding mode (step S304-1 f). If the resultis YES, the image-quality parameter is decreased (step S304-1 g), so asto perform the embedding step (step S304-1 k).

On the other hand, when the result of step S304-1 f is NO, it isdetermined whether or not the input embedding mode is theimage-quality-priority forced embedding mode (S304-1 h). If the resultis YES, the robustness parameter is decreased (step S304-1 i), so as toperform the embedding step (step S304-1 k). On the other hand, if theresult is NO, the mode is the normal mode. In this case, embeddingfailure is notified to the user (step S304-1 j), so as to end theprocess.

Sixth Embodiment

In the fifth embodiment, information input by the user is embedded inaccordance with an embedding mode, and the embedding process is ended infailure if embedding capacity is insufficient. In the sixth embodiment,capacity which is available for embedding is presented in advance, sothat the user can specify embedding strength. Hereinafter, partdifferent from that of the fifth embodiment will be described withreference to the drawings.

FIG. 22 is a flowchart for explaining the operation of thedigital-watermark embedding device according to the sixth embodiment. Astep of obtaining basic data for calculating embedding capacity (stepS304-2 a), a step of calculating embedding capacity (step S304-2 b), anda step of associating parameters with embedding strength (step S304-2 c)are the same as in the fifth embodiment. Then, a list of obtainedembedding strength and corresponding embedding capacity is presented tothe user (step S304-2 d).

The user refers to the presented information so as to know constraint ofembedding strength for obtaining desired embedding strength. Afterobtaining the information, the user inputs embedding strength,information to be embedded, and an embedding mode for specifying theextent to which embedding parameters can be changed (step S304-2 e). Thefollowing steps are the same as in the fifth embodiment.

Seventh Embodiment

In the fifth and sixth embodiments, digital-watermark information isembedded by rotating a letter. The digital-watermark information canalso be embedded by changing the space (length) between letters, as inthe fourth embodiment. This method has been described above, and thus isnot described here.

When digital-watermark information is embedded by changing the spacebetween letters and when basic data for calculating embedding capacityis obtained in step S304-2 b in FIG. 22, the data is not a simple numberof letters, but ½ of the number of spaces between letters. The methodfor calculating the other values is the same as the above.

FIG. 23 shows an electrical configuration of the digital-watermarkembedding device of the present invention. In order to realize thedigital-watermark embedding device, all the functions shown in FIG. 23are not necessarily required.

In FIG. 23, a computer 1401 is a generally-used personal computer. Animage is read by an image input device 1417, such as a scanner, and isinput to the computer 1401, where the image may be edited and storedtherein. Also, the image obtained through the image input device 1417can be printed by a printer 1416. Instructions from the user are inputthrough a mouse 1413 or a keyboard 1414.

In the computer 1401, blocks (described later) are connected to eachother through a bus 1407, so that various types of data may betransmitted/received by the blocks. In FIG. 23, an MPU 1402 controls theoperations of the blocks in the computer 1401 and executes a storedprogram. A main memory 1403 is used for temporarily storing a program orimage data to be processed, for the process executed by the MPU 1402. Ahard disk drive (HDD) 1404 can store a program and image data to betransferred to the main memory 1403 and so on and can store processedimage data.

A scanner interface (I/F) 1415 is connected to the scanner 1417, whichscans a document or a film so as to generate image data, and the imagedata obtained by the scanner 1417 can be input through the scannerinterface 1415. A printer interface 1408 is connected to the printer1416, which prints image data, and transmits the image data to beprinted to the printer 1416.

A CD drive 1409 reads data stored in a CD (CD-R/CD-RW) into thecomputer, the CD being an external storage medium, and writes out thedata. An FD drive 1411 reads data stored in an FD into the computer andwrites out the data, as the CD drive 1409. A DVD drive 1410 reads datastored in a DVD into the computer and writes out the data, as the FDdrive 1411. When a program for editing images or a printer driver isstored in the CD, FD, or DVD, the program is installed in the HDD 1404,and then the program is transferred to the main memory 1403 as required.

An interface (I/F) 1412 is connected to the mouse 1413 and the keyboard1414 so as to receive input instructions therefrom. A monitor 1406 is adisplay device for displaying a result of extracting process andprocessing of digital-watermark information. A video controller 1405 isused for transmitting display data to the monitor 1406.

The present invention may be applied to a system including a pluralityof devices (for example, host computer, interface device, reader, andprinter) or may be applied to a single device (for example, copyingmachine or fax machine).

Of course, the object of the present invention can be achieved bysupplying a recording medium (or storage medium) containing program codeof software for realizing the function of the above-describedembodiments to a system or device so that the program code stored in therecording medium is read and executed by the computer (or CPU or MPU) inthe system or device. In this case, the program code itself read fromthe recording medium realizes the function of the above-describedembodiments. Therefore, the recording medium containing the program codeis included in the present invention.

The functions of the above-described embodiments may be realized byexecuting the program code read by the computer. In addition, anoperating system (OS) working in the computer may execute part or wholeof actual processing based on the instructions of the program code, sothat the functions of the above-described embodiments are realized bythe processing.

Further, the program code read from the recording medium may be writtenin a memory provided in an expansions card inserted into the computer oran expansions unit connected to the computer and a CPU provided in theexpansions card or the expansions unit may execute part or whole ofactual processing based on the instructions of the program code, so thatthe functions of the above-described embodiments are realized by theprocessing.

If the present invention is applied to the recording medium, the programcode corresponding to the above-described flowcharts is stored in therecording medium.

As described above, according to the present invention, an error statein which digital-watermark information cannot be embedded can besuppressed. That is, digital-watermark information can be embeddedforcedly. Also, various parameters can be efficiently adjusted inaccordance with a desired priority. Specifically, when a high priorityis given to image quality, various parameters can be changed stepwisewhile the image quality can be maintained. On the other hand, when ahigh priority is given to robustness to attack (embedding strength),various parameters can be changed stepwise while the robustness can bemaintained.

The priority can be set before operation, or when it is determined thatthe entire digital-watermark information cannot be embedded correctly inan image. That is, the priority should be set before deciding the mostimportant parameter so as to change parameter group.

Further, according to the method of the present invention, a user canrecognize the relationship between the amount of information which canbe embedded and embedding strength when digital-watermark information isembedded in a document image.

While the present invention has been described with reference to whatare presently considered to be the preferred embodiments, it is to beunderstood that the invention is not limited to the disclosedembodiments. On the contrary, the invention is intended to cover variousmodifications and equivalent arrangements included within the spirit andscope of the appended claims. The scope of the following claims is to beaccorded the broadest interpretation so as to encompass all suchmodifications and equivalent structures and functions.

1. A method for embedding a digital-watermark in a document image,comprising: inputting the document image and digital-watermarkinformation; counting a number of letters in the document image;calculating an embedding capacity based on the number of the letters;determining whether or not the entire digital-watermark information iscapable of being embedded in the document image based on the calculatedembedding capacity; and embedding the digital-watermark information inthe document image based on a result of the determination of whether ornot the entire digital-watermark information is capable of beingembedded in the document image.
 2. The method according to claim 1,further comprising: inputting an embedding strength of thedigital-watermark; and setting a first parameter determining robustnessto attack on the digital-watermark information to be embedded in theimage and a second parameter determining quality of the image in whichthe digital-watermark information is to be embedded in accordance withthe embedding strength, wherein the embedding capacity is calculatedbased on the number of letters and the embedding strength, and wherein,when it is determined that the entire digital-watermark information isnot capable of being embedded, at least one of the parameters is updatedso as to embed a larger amount of the digital-watermark information inthe image in accordance with a robustness-priority forced embedding modeor an image-quality-priority forced embedding mode, and thedigital-watermark is embedded using the updated parameter.
 3. The methodaccording to claim 2, wherein the digital-watermark information isembedded in the document image by rotating the letters so as to changethe inclination angle of the letters.
 4. The method according to claim3, wherein the second parameter specifies the range of rotation angle ofthe letters.
 5. The method according to claim 3, wherein the firstparameter specifies the repetition number of embedding thedigital-watermark information in the image.
 6. The method according toclaim 2, wherein the digital-watermark information is embedded in thedocument image by changing the positions of the letters so as to adjustspaces between the letters.
 7. The method according to claim 6, whereinthe second parameter specifies the range of movement of the letters. 8.The method according to claim 6, wherein the first parameter specifiesthe repetition number of embedding the digital-watermark information inthe image.
 9. An apparatus comprising: an input unit configured toreceive a document image and digital-watermark information; a firstdetermination unit configured to determine an embedding capacity basedon a number of the letters in the document image; a second determinationunit configured to determine whether or not the entire digital-watermarkinformation is capable of being embedded in the document image based onthe determined embedding capacity; and an embedding unit configured toembed the digital-watermark information in the document image based on aresult of the determination of whether or not the entiredigital-watermark information is capable of being embedded in thedocument image.
 10. The apparatus according to claim 9, furthercomprising: an embedding strength input unit configured receiveinformation associated with an embedding strength of thedigital-watermark; and a setting unit configured to set a firstparameter determining robustness to attack on the digital-watermarkinformation to be embedded in the image and a second parameterdetermining quality of the image in which the digital-watermarkinformation is to be embedded based on the information associated withthe embedding strength of the digital-watermark, wherein the embeddingcapacity is determined based on the number of letters and theinformation associated with the embedding strength of thedigital-watermark, wherein, when it is determined that the entiredigital-watermark information is not capable of being embedded, at leastone of the parameters is updated so as to embed a larger amount of thedigital-watermark information in the image in accordance with arobustness-priority forced embedding mode or an image-quality-priorityforced embedding mode, and the digital-watermark is embedded using theupdated parameter.
 11. A computer-readable medium storing instructionswhich, when executed by an apparatus, causes the apparatus to performoperations comprising: receiving a document image and digital-watermarkinformation; determining an embedding capacity based on a number of theletters in the document image; determining whether or not the entiredigital-watermark information is capable of being embedded in thedocument image based on the determined embedding capacity; and embeddingthe digital-watermark information in the document image based on aresult of the determination of whether or not the entiredigital-watermark information is capable of being embedded in thedocument image.
 12. The computer-readable medium according to claim 11,wherein the operations further comprise: receiving informationassociated with an embedding strength of the digital-watermark; andsetting a first parameter determining robustness to attack on thedigital-watermark information to be embedded in the image and a secondparameter determining quality of the image in which thedigital-watermark information is to be embedded based on the informationassociated with the embedding strength of the digital-watermark, whereinthe embedding capacity is determined based on the number of letters andthe information associated with the embedding strength of the digitalwatermark, and wherein, when it is determined that the entiredigital-watermark information is not capable of being embedded, at leastone of the parameters is updated so as to embed a larger amount of thedigital-watermark information in the image in accordance with arobustness-priority forced embedding mode or an image-quality-priorityforced embedding mode, and the digital-watermark is embedded using theupdated parameter.